!function(e,t){void 0===e&&void 0!==window&&(e=window),"function"==typeof define&&define.amd?define(["jquery"],function(e){return t(e)}):"object"==typeof module&&module.exports?module.exports=t(require("jquery")):t(e.jQuery)}(this,function(e){!function(L){"use strict";var p=["sanitize","whiteList","sanitizeFn"],l=["background","cite","href","itemtype","longdesc","poster","src","xlink:href"],r=/^(?:(?:https?|mailto|ftp|tel|file):|[^&:/?#]*(?:[/?#]|$))/gi,a=/^data:(?:image\/(?:bmp|gif|jpeg|jpg|png|tiff|webp)|video\/(?:mpeg|mp4|ogg|webm)|audio\/(?:mp3|oga|ogg|opus));base64,[a-z0-9+/]+=*$/i;function g(e,t){var i=e.nodeName.toLowerCase();if(-1!==L.inArray(i,t))return-1===L.inArray(i,l)||Boolean(e.nodeValue.match(r)||e.nodeValue.match(a));for(var s=L(t).filter(function(e,t){return t instanceof RegExp}),n=0,o=s.length;n]+>/g,"")),s&&(a=b(a)),a=a.toUpperCase(),o="contains"===i?0<=a.indexOf(t):a.startsWith(t)))break}return o}function D(e){return parseInt(e,10)||0}L.fn.triggerNative=function(e){var t,i=this[0];i.dispatchEvent?(d?t=new Event(e,{bubbles:!0}):(t=document.createEvent("Event")).initEvent(e,!0,!1),i.dispatchEvent(t)):i.fireEvent?((t=document.createEventObject()).eventType=e,i.fireEvent("on"+e,t)):this.trigger(e)};var u={"À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","Ç":"C","ç":"c","Ð":"D","ð":"d","È":"E","É":"E","Ê":"E","Ë":"E","è":"e","é":"e","ê":"e","ë":"e","Ì":"I","Í":"I","Î":"I","Ï":"I","ì":"i","í":"i","î":"i","ï":"i","Ñ":"N","ñ":"n","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ø":"O","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","Ù":"U","Ú":"U","Û":"U","Ü":"U","ù":"u","ú":"u","û":"u","ü":"u","Ý":"Y","ý":"y","ÿ":"y","Æ":"Ae","æ":"ae","Þ":"Th","þ":"th","ß":"ss","Ā":"A","Ă":"A","Ą":"A","ā":"a","ă":"a","ą":"a","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","ć":"c","ĉ":"c","ċ":"c","č":"c","Ď":"D","Đ":"D","ď":"d","đ":"d","Ē":"E","Ĕ":"E","Ė":"E","Ę":"E","Ě":"E","ē":"e","ĕ":"e","ė":"e","ę":"e","ě":"e","Ĝ":"G","Ğ":"G","Ġ":"G","Ģ":"G","ĝ":"g","ğ":"g","ġ":"g","ģ":"g","Ĥ":"H","Ħ":"H","ĥ":"h","ħ":"h","Ĩ":"I","Ī":"I","Ĭ":"I","Į":"I","İ":"I","ĩ":"i","ī":"i","ĭ":"i","į":"i","ı":"i","Ĵ":"J","ĵ":"j","Ķ":"K","ķ":"k","ĸ":"k","Ĺ":"L","Ļ":"L","Ľ":"L","Ŀ":"L","Ł":"L","ĺ":"l","ļ":"l","ľ":"l","ŀ":"l","ł":"l","Ń":"N","Ņ":"N","Ň":"N","Ŋ":"N","ń":"n","ņ":"n","ň":"n","ŋ":"n","Ō":"O","Ŏ":"O","Ő":"O","ō":"o","ŏ":"o","ő":"o","Ŕ":"R","Ŗ":"R","Ř":"R","ŕ":"r","ŗ":"r","ř":"r","Ś":"S","Ŝ":"S","Ş":"S","Š":"S","ś":"s","ŝ":"s","ş":"s","š":"s","Ţ":"T","Ť":"T","Ŧ":"T","ţ":"t","ť":"t","ŧ":"t","Ũ":"U","Ū":"U","Ŭ":"U","Ů":"U","Ű":"U","Ų":"U","ũ":"u","ū":"u","ŭ":"u","ů":"u","ű":"u","ų":"u","Ŵ":"W","ŵ":"w","Ŷ":"Y","ŷ":"y","Ÿ":"Y","Ź":"Z","Ż":"Z","Ž":"Z","ź":"z","ż":"z","ž":"z","IJ":"IJ","ij":"ij","Œ":"Oe","œ":"oe","ʼn":"'n","ſ":"s"},f=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,m=RegExp("[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff\\u1ab0-\\u1aff\\u1dc0-\\u1dff]","g");function v(e){return u[e]}function b(e){return(e=e.toString())&&e.replace(f,v).replace(m,"")}var w,x,I,k,O=(w={"&":"&","<":"<",">":">",'"':""","'":"'","`":"`"},x="(?:"+Object.keys(w).join("|")+")",I=RegExp(x),k=RegExp(x,"g"),function(e){return e=null==e?"":""+e,I.test(e)?e.replace(k,$):e});function $(e){return w[e]}var S={32:" ",48:"0",49:"1",50:"2",51:"3",52:"4",53:"5",54:"6",55:"7",56:"8",57:"9",59:";",65:"A",66:"B",67:"C",68:"D",69:"E",70:"F",71:"G",72:"H",73:"I",74:"J",75:"K",76:"L",77:"M",78:"N",79:"O",80:"P",81:"Q",82:"R",83:"S",84:"T",85:"U",86:"V",87:"W",88:"X",89:"Y",90:"Z",96:"0",97:"1",98:"2",99:"3",100:"4",101:"5",102:"6",103:"7",104:"8",105:"9"},N={success:!1,major:"3"};try{N.full=(L.fn.dropdown.Constructor.VERSION||"").split(" ")[0].split("."),N.major=N.full[0],N.success=!0}catch(e){}var E=0,P=".bs.select",U={DISABLED:"disabled",DIVIDER:"divider",SHOW:"open",DROPUP:"dropup",MENU:"dropdown-menu",MENURIGHT:"dropdown-menu-right",MENULEFT:"dropdown-menu-left",BUTTONCLASS:"btn-default",POPOVERHEADER:"popover-title",ICONBASE:"glyphicon",TICKICON:"glyphicon-ok"},z={MENU:"."+U.MENU},R={span:document.createElement("span"),i:document.createElement("i"),subtext:document.createElement("small"),a:document.createElement("a"),li:document.createElement("li"),whitespace:document.createTextNode(" "),fragment:document.createDocumentFragment()};R.a.setAttribute("role","option"),R.subtext.className="text-muted",R.text=R.span.cloneNode(!1),R.text.className="text",R.checkMark=R.span.cloneNode(!1);var H=new RegExp("38|40"),B=new RegExp("^9$|27"),j=function(e,t,i){var s=R.li.cloneNode(!1);return e&&(1===e.nodeType||11===e.nodeType?s.appendChild(e):s.innerHTML=e),void 0!==t&&""!==t&&(s.className=t),null!=i&&s.classList.add("optgroup-"+i),s},W=function(e,t){var i,s,n=R.text.cloneNode(!1);if(e.content)n.innerHTML=e.content;else{if(n.textContent=e.text,e.icon){var o=R.whitespace.cloneNode(!1);(s=(!0===t?R.i:R.span).cloneNode(!1)).className=e.iconBase+" "+e.icon,R.fragment.appendChild(s),R.fragment.appendChild(o)}e.subtext&&((i=R.subtext.cloneNode(!1)).textContent=e.subtext,n.appendChild(i))}if(!0===t)for(;0'},maxOptions:!1,mobile:!1,selectOnTab:!1,dropdownAlignRight:!1,windowPadding:0,virtualScroll:600,display:!1,sanitize:!0,sanitizeFn:null,whiteList:{"*":["class","dir","id","lang","role","tabindex","style",/^aria-[\w-]*$/i],a:["target","href","title","rel"],area:[],b:[],br:[],col:[],code:[],div:[],em:[],hr:[],h1:[],h2:[],h3:[],h4:[],h5:[],h6:[],i:[],img:["src","alt","title","width","height"],li:[],ol:[],p:[],pre:[],s:[],small:[],span:[],sub:[],sup:[],strong:[],u:[],ul:[]}},_.prototype={constructor:_,init:function(){var i=this,e=this.$element.attr("id");E++,this.selectId="bs-select-"+E,this.$element[0].classList.add("bs-select-hidden"),this.multiple=this.$element.prop("multiple"),this.autofocus=this.$element.prop("autofocus"),this.$element[0].classList.contains("show-tick")&&(this.options.showTick=!0),this.$newElement=this.createDropdown(),this.$element.after(this.$newElement).prependTo(this.$newElement),this.$button=this.$newElement.children("button"),this.$menu=this.$newElement.children(z.MENU),this.$menuInner=this.$menu.children(".inner"),this.$searchbox=this.$menu.find("input"),this.$element[0].classList.remove("bs-select-hidden"),!0===this.options.dropdownAlignRight&&this.$menu[0].classList.add(U.MENURIGHT),void 0!==e&&this.$button.attr("data-id",e),this.checkDisabled(),this.clickListener(),this.options.liveSearch?(this.liveSearchListener(),this.focusedParent=this.$searchbox[0]):this.focusedParent=this.$menuInner[0],this.setStyle(),this.render(),this.setWidth(),this.options.container?this.selectPosition():this.$element.on("hide"+P,function(){if(i.isVirtual()){var e=i.$menuInner[0],t=e.firstChild.cloneNode(!1);e.replaceChild(t,e.firstChild),e.scrollTop=0}}),this.$menu.data("this",this),this.$newElement.data("this",this),this.options.mobile&&this.mobile(),this.$newElement.on({"hide.bs.dropdown":function(e){i.$element.trigger("hide"+P,e)},"hidden.bs.dropdown":function(e){i.$element.trigger("hidden"+P,e)},"show.bs.dropdown":function(e){i.$element.trigger("show"+P,e)},"shown.bs.dropdown":function(e){i.$element.trigger("shown"+P,e)}}),i.$element[0].hasAttribute("required")&&this.$element.on("invalid"+P,function(){i.$button[0].classList.add("bs-invalid"),i.$element.on("shown"+P+".invalid",function(){i.$element.val(i.$element.val()).off("shown"+P+".invalid")}).on("rendered"+P,function(){this.validity.valid&&i.$button[0].classList.remove("bs-invalid"),i.$element.off("rendered"+P)}),i.$button.on("blur"+P,function(){i.$element.trigger("focus").trigger("blur"),i.$button.off("blur"+P)})}),setTimeout(function(){i.createLi(),i.$element.trigger("loaded"+P)})},createDropdown:function(){var e=this.multiple||this.options.showTick?" show-tick":"",t=this.multiple?' aria-multiselectable="true"':"",i="",s=this.autofocus?" autofocus":"";N.major<4&&this.$element.parent().hasClass("input-group")&&(i=" input-group-btn");var n,o="",l="",r="",a="";return this.options.header&&(o='
'+this.options.header+"
"),this.options.liveSearch&&(l=''),this.multiple&&this.options.actionsBox&&(r='
"),this.multiple&&this.options.doneButton&&(a='
"),n='",L(n)},setPositionData:function(){this.selectpicker.view.canHighlight=[];for(var e=this.selectpicker.view.size=0;e=this.options.virtualScroll||!0===this.options.virtualScroll},createView:function(N,e,t){var z,R,H=this,i=0,B=[];if(this.selectpicker.current=N?this.selectpicker.search:this.selectpicker.main,this.setPositionData(),e)if(t)i=this.$menuInner[0].scrollTop;else if(!H.multiple){var s=H.$element[0],n=(s.options[s.selectedIndex]||{}).liIndex;if("number"==typeof n&&!1!==H.options.size){var o=H.selectpicker.main.data[n],l=o&&o.position;l&&(i=l-(H.sizeInfo.menuInnerHeight+H.sizeInfo.liHeight)/2)}}function r(e,t){var i,s,n,o,l,r,a,c,p,h,d=H.selectpicker.current.elements.length,u=[],f=!0,m=H.isVirtual();H.selectpicker.view.scrollTop=e,i=Math.ceil(H.sizeInfo.menuInnerHeight/H.sizeInfo.liHeight*1.5),s=Math.round(d/i)||1;for(var g=0;gd-1?0:H.selectpicker.current.data[d-1].position-H.selectpicker.current.data[H.selectpicker.view.position1-1].position,x.firstChild.style.marginTop=b+"px",x.firstChild.style.marginBottom=w+"px"):(x.firstChild.style.marginTop=0,x.firstChild.style.marginBottom=0),x.firstChild.appendChild(I),!0===m&&H.sizeInfo.hasScrollBar){var L=x.firstChild.offsetWidth;if(t&&LH.sizeInfo.selectWidth)x.firstChild.style.minWidth=H.sizeInfo.menuInnerInnerWidth+"px";else if(L>H.sizeInfo.menuInnerInnerWidth){H.$menu[0].style.minWidth=0;var T=x.firstChild.offsetWidth;T>H.sizeInfo.menuInnerInnerWidth&&(H.sizeInfo.menuInnerInnerWidth=T,x.firstChild.style.minWidth=H.sizeInfo.menuInnerInnerWidth+"px"),H.$menu[0].style.minWidth=""}}}if(H.prevActiveIndex=H.activeIndex,H.options.liveSearch){if(N&&t){var A,D=0;H.selectpicker.view.canHighlight[D]||(D=1+H.selectpicker.view.canHighlight.slice(1).indexOf(!0)),A=H.selectpicker.view.visibleElements[D],H.defocusItem(H.selectpicker.view.currentActive),H.activeIndex=(H.selectpicker.current.data[D]||{}).index,H.focusItem(A)}}else H.$menuInner.trigger("focus")}r(i,!0),this.$menuInner.off("scroll.createView").on("scroll.createView",function(e,t){H.noScroll||r(this.scrollTop,t),H.noScroll=!1}),L(window).off("resize"+P+"."+this.selectId+".createView").on("resize"+P+"."+this.selectId+".createView",function(){H.$newElement.hasClass(U.SHOW)&&r(H.$menuInner[0].scrollTop)})},focusItem:function(e,t,i){if(e){t=t||this.selectpicker.main.data[this.activeIndex];var s=e.firstChild;s&&(s.setAttribute("aria-setsize",this.selectpicker.view.size),s.setAttribute("aria-posinset",t.posinset),!0!==i&&(this.focusedParent.setAttribute("aria-activedescendant",s.id),e.classList.add("active"),s.classList.add("active")))}},defocusItem:function(e){e&&(e.classList.remove("active"),e.firstChild&&e.firstChild.classList.remove("active"))},setPlaceholder:function(){var e=!1;if(this.options.title&&!this.multiple){this.selectpicker.view.titleOption||(this.selectpicker.view.titleOption=document.createElement("option")),e=!0;var t=this.$element[0],i=!1,s=!this.selectpicker.view.titleOption.parentNode;s&&(this.selectpicker.view.titleOption.className="bs-title-option",this.selectpicker.view.titleOption.value="",i=void 0===L(t.options[t.selectedIndex]).attr("selected")&&void 0===this.$element.data("selected")),!s&&0===this.selectpicker.view.titleOption.index||t.insertBefore(this.selectpicker.view.titleOption,t.firstChild),i&&(t.selectedIndex=0)}return e},createLi:function(){var u=this,f=this.options.iconBase,m=':not([hidden]):not([data-hidden="true"])',g=[],v=[],b=0,w=0,e=this.setPlaceholder()?1:0;this.options.hideDisabled&&(m+=":not(:disabled)"),!u.options.showTick&&!u.multiple||R.checkMark.parentNode||(R.checkMark.className=f+" "+u.options.tickIcon+" check-mark",R.a.appendChild(R.checkMark));var t=this.$element[0].querySelectorAll("select > *"+m);function x(e){var t=v[v.length-1];t&&"divider"===t.type&&(t.optID||e.optID)||((e=e||{}).type="divider",g.push(j(!1,U.DIVIDER,e.optID?e.optID+"div":void 0)),v.push(e))}function I(e,t){if((t=t||{}).divider="true"===e.getAttribute("data-divider"),t.divider)x({optID:t.optID});else{var i=v.length,s=e.style.cssText,n=s?O(s):"",o=(e.className||"")+(t.optgroupClass||"");t.optID&&(o="opt "+o),t.text=e.textContent,t.content=e.getAttribute("data-content"),t.tokens=e.getAttribute("data-tokens"),t.subtext=e.getAttribute("data-subtext"),t.icon=e.getAttribute("data-icon"),t.iconBase=f;var l=W(t),r=j((c=l,p=o,h=n,d=R.a.cloneNode(!0),c&&(11===c.nodeType?d.appendChild(c):d.insertAdjacentHTML("beforeend",c)),void 0!==p&&""!==p&&(d.className=p),"4"===N.major&&d.classList.add("dropdown-item"),h&&d.setAttribute("style",h),d),"",t.optID);r.firstChild&&(r.firstChild.id=u.selectId+"-"+i),g.push(r),e.liIndex=i,t.display=t.content||t.text,t.type="option",t.index=i,t.option=e,t.disabled=t.disabled||e.disabled,v.push(t);var a=0;t.display&&(a+=t.display.length),t.subtext&&(a+=t.subtext.length),t.icon&&(a+=1),b li")},render:function(){this.setPlaceholder();var e,t=this,i=this.$element[0],s=C(i,this.options.hideDisabled),n=s.length,o=this.$button[0],l=o.querySelector(".filter-option-inner-inner"),r=document.createTextNode(this.options.multipleSeparator),a=R.fragment.cloneNode(!1),c=!1;if(o.classList.toggle("bs-placeholder",t.multiple?!n:!T(i,s)),this.tabIndex(),"static"===this.options.selectedTextFormat)a=W({text:this.options.title},!0);else if(!1===(this.multiple&&-1!==this.options.selectedTextFormat.indexOf("count")&&1")).length&&n>e[1]||1===e.length&&2<=n))){for(var p=0;p option"+f+", optgroup"+f+" option"+f).length,g="function"==typeof this.options.countSelectedText?this.options.countSelectedText(n,m):this.options.countSelectedText;a=W({text:g.replace("{0}",n.toString()).replace("{1}",m.toString())},!0)}if(null==this.options.title&&(this.options.title=this.$element.attr("title")),a.childNodes.length||(a=W({text:void 0!==this.options.title?this.options.title:this.options.noneSelectedText},!0)),o.title=a.textContent.replace(/<[^>]*>?/g,"").trim(),this.options.sanitize&&c&&G([a],t.options.whiteList,t.options.sanitizeFn),l.innerHTML="",l.appendChild(a),N.major<4&&this.$newElement[0].classList.contains("bs3-has-addon")){var v=o.querySelector(".filter-expand"),b=l.cloneNode(!0);b.className="filter-expand",v?o.replaceChild(b,v):o.appendChild(b)}this.$element.trigger("rendered"+P)},setStyle:function(e,t){var i,s=this.$button[0],n=this.$newElement[0],o=this.options.style.trim();this.$element.attr("class")&&this.$newElement.addClass(this.$element.attr("class").replace(/selectpicker|mobile-device|bs-select-hidden|validate\[.*\]/gi,"")),N.major<4&&(n.classList.add("bs3"),n.parentNode.classList.contains("input-group")&&(n.previousElementSibling||n.nextElementSibling)&&(n.previousElementSibling||n.nextElementSibling).classList.contains("input-group-addon")&&n.classList.add("bs3-has-addon")),i=e?e.trim():o,"add"==t?i&&s.classList.add.apply(s.classList,i.split(" ")):"remove"==t?i&&s.classList.remove.apply(s.classList,i.split(" ")):(o&&s.classList.remove.apply(s.classList,o.split(" ")),i&&s.classList.add.apply(s.classList,i.split(" ")))},liHeight:function(e){if(e||!1!==this.options.size&&!this.sizeInfo){this.sizeInfo||(this.sizeInfo={});var t=document.createElement("div"),i=document.createElement("div"),s=document.createElement("div"),n=document.createElement("ul"),o=document.createElement("li"),l=document.createElement("li"),r=document.createElement("li"),a=document.createElement("a"),c=document.createElement("span"),p=this.options.header&&0this.sizeInfo.menuExtras.vert&&r+this.sizeInfo.menuExtras.vert+50>this.sizeInfo.selectOffsetBot)),"auto"===this.options.size)n=3this.options.size){for(var v=0;vthis.sizeInfo.menuInnerHeight&&(this.sizeInfo.hasScrollBar=!0,this.sizeInfo.totalMenuWidth=this.sizeInfo.menuWidth+this.sizeInfo.scrollBarWidth),"auto"===this.options.dropdownAlignRight&&this.$menu.toggleClass(U.MENURIGHT,this.sizeInfo.selectOffsetLeft>this.sizeInfo.selectOffsetRight&&this.sizeInfo.selectOffsetRightthis.options.size&&i.off("resize"+P+"."+this.selectId+".setMenuSize scroll"+P+"."+this.selectId+".setMenuSize"),t.createView(!1,!0,e)}},setWidth:function(){var i=this;"auto"===this.options.width?requestAnimationFrame(function(){i.$menu.css("min-width","0"),i.$element.on("loaded"+P,function(){i.liHeight(),i.setMenuSize();var e=i.$newElement.clone().appendTo("body"),t=e.css("width","auto").children("button").outerWidth();e.remove(),i.sizeInfo.selectWidth=Math.max(i.sizeInfo.totalMenuWidth,t),i.$newElement.css("width",i.sizeInfo.selectWidth+"px")})}):"fit"===this.options.width?(this.$menu.css("min-width",""),this.$newElement.css("width","").addClass("fit-width")):this.options.width?(this.$menu.css("min-width",""),this.$newElement.css("width",this.options.width)):(this.$menu.css("min-width",""),this.$newElement.css("width","")),this.$newElement.hasClass("fit-width")&&"fit"!==this.options.width&&this.$newElement[0].classList.remove("fit-width")},selectPosition:function(){function e(e){var t={},i=l.options.display||!!L.fn.dropdown.Constructor.Default&&L.fn.dropdown.Constructor.Default.display;l.$bsContainer.addClass(e.attr("class").replace(/form-control|fit-width/gi,"")).toggleClass(U.DROPUP,e.hasClass(U.DROPUP)),s=e.offset(),r.is("body")?n={top:0,left:0}:((n=r.offset()).top+=parseInt(r.css("borderTopWidth"))-r.scrollTop(),n.left+=parseInt(r.css("borderLeftWidth"))-r.scrollLeft()),o=e.hasClass(U.DROPUP)?0:e[0].offsetHeight,(N.major<4||"static"===i)&&(t.top=s.top-n.top+o,t.left=s.left-n.left),t.width=e[0].offsetWidth,l.$bsContainer.css(t)}this.$bsContainer=L('
');var s,n,o,l=this,r=L(this.options.container);this.$button.on("click.bs.dropdown.data-api",function(){l.isDisabled()||(e(l.$newElement),l.$bsContainer.appendTo(l.options.container).toggleClass(U.SHOW,!l.$button.hasClass(U.SHOW)).append(l.$menu))}),L(window).off("resize"+P+"."+this.selectId+" scroll"+P+"."+this.selectId).on("resize"+P+"."+this.selectId+" scroll"+P+"."+this.selectId,function(){l.$newElement.hasClass(U.SHOW)&&e(l.$newElement)}),this.$element.on("hide"+P,function(){l.$menu.data("height",l.$menu.height()),l.$bsContainer.detach()})},setOptionStatus:function(e){var t=this;if(t.noScroll=!1,t.selectpicker.view.visibleElements&&t.selectpicker.view.visibleElements.length)for(var i=0;i
');k[2]&&(O=O.replace("{var}",k[2][1"+O+"")),p=!1,E.$element.trigger("maxReached"+P)),v&&w&&(S.append(L("
"+$+"
")),p=!1,E.$element.trigger("maxReachedGrp"+P)),setTimeout(function(){E.setSelected(l,!1)},10),S[0].classList.add("fadeOut"),setTimeout(function(){S.remove()},1050)}}}else c&&(c.selected=!1),h.selected=!0,E.setSelected(l,!0);!E.multiple||E.multiple&&1===E.options.maxOptions?E.$button.trigger("focus"):E.options.liveSearch&&E.$searchbox.trigger("focus"),p&&(!E.multiple&&a===s.selectedIndex||(A=[h.index,d.prop("selected"),r],E.$element.triggerNative("change")))}}),this.$menu.on("click","li."+U.DISABLED+" a, ."+U.POPOVERHEADER+", ."+U.POPOVERHEADER+" :not(.close)",function(e){e.currentTarget==this&&(e.preventDefault(),e.stopPropagation(),E.options.liveSearch&&!L(e.target).hasClass("close")?E.$searchbox.trigger("focus"):E.$button.trigger("focus"))}),this.$menuInner.on("click",".divider, .dropdown-header",function(e){e.preventDefault(),e.stopPropagation(),E.options.liveSearch?E.$searchbox.trigger("focus"):E.$button.trigger("focus")}),this.$menu.on("click","."+U.POPOVERHEADER+" .close",function(){E.$button.trigger("click")}),this.$searchbox.on("click",function(e){e.stopPropagation()}),this.$menu.on("click",".actions-btn",function(e){E.options.liveSearch?E.$searchbox.trigger("focus"):E.$button.trigger("focus"),e.preventDefault(),e.stopPropagation(),L(this).hasClass("bs-select-all")?E.selectAll():E.deselectAll()}),this.$element.on("change"+P,function(){E.render(),E.$element.trigger("changed"+P,A),A=null}).on("focus"+P,function(){E.options.mobile||E.$button.trigger("focus")})},liveSearchListener:function(){var u=this,f=document.createElement("li");this.$button.on("click.bs.dropdown.data-api",function(){u.$searchbox.val()&&u.$searchbox.val("")}),this.$searchbox.on("click.bs.dropdown.data-api focus.bs.dropdown.data-api touchend.bs.dropdown.data-api",function(e){e.stopPropagation()}),this.$searchbox.on("input propertychange",function(){var e=u.$searchbox.val();if(u.selectpicker.search.elements=[],u.selectpicker.search.data=[],e){var t=[],i=e.toUpperCase(),s={},n=[],o=u._searchStyle(),l=u.options.liveSearchNormalize;l&&(i=b(i)),u._$lisSelected=u.$menuInner.find(".selected");for(var r=0;r=a.selectpicker.view.canHighlight.length&&(t=0),a.selectpicker.view.canHighlight[t+f]||(t=t+1+a.selectpicker.view.canHighlight.slice(t+f+1).indexOf(!0))),e.preventDefault();var m=f+t;38===e.which?0===f&&t===c.length-1?(a.$menuInner[0].scrollTop=a.$menuInner[0].scrollHeight,m=a.selectpicker.current.elements.length-1):p=(o=(n=a.selectpicker.current.data[m]).position-n.height)u+a.sizeInfo.menuInnerHeight),s=a.selectpicker.main.elements[g],a.activeIndex=b[I],a.focusItem(s),s&&s.firstChild.focus(),p&&(a.$menuInner[0].scrollTop=o),l.trigger("focus")}}i&&(32===e.which&&!a.selectpicker.keydown.keyHistory||13===e.which||9===e.which&&a.options.selectOnTab)&&(32!==e.which&&e.preventDefault(),a.options.liveSearch&&32===e.which||(a.$menuInner.find(".active a").trigger("click",!0),l.trigger("focus"),a.options.liveSearch||(e.preventDefault(),L(document).data("spaceSelect",!0))))}},mobile:function(){this.$element[0].classList.add("mobile-device")},refresh:function(){var e=L.extend({},this.options,this.$element.data());this.options=e,this.checkDisabled(),this.setStyle(),this.render(),this.createLi(),this.setWidth(),this.setSize(!0),this.$element.trigger("refreshed"+P)},hide:function(){this.$newElement.hide()},show:function(){this.$newElement.show()},remove:function(){this.$newElement.remove(),this.$element.remove()},destroy:function(){this.$newElement.before(this.$element).remove(),this.$bsContainer?this.$bsContainer.remove():this.$menu.remove(),this.$element.off(P).removeData("selectpicker").removeClass("bs-select-hidden selectpicker"),L(window).off(P+"."+this.selectId)}};var q=L.fn.selectpicker;L.fn.selectpicker=M,L.fn.selectpicker.Constructor=_,L.fn.selectpicker.noConflict=function(){return L.fn.selectpicker=q,this},L(document).off("keydown.bs.dropdown.data-api",'.bootstrap-select [data-toggle="dropdown"], .bootstrap-select .dropdown-menu').on("keydown"+P,'.bootstrap-select [data-toggle="dropdown"], .bootstrap-select [role="listbox"], .bootstrap-select .bs-searchbox input',_.prototype.keydown).on("focusin.modal",'.bootstrap-select [data-toggle="dropdown"], .bootstrap-select [role="listbox"], .bootstrap-select .bs-searchbox input',function(e){e.stopPropagation()}),L(window).on("load"+P+".data-api",function(){L(".selectpicker").each(function(){var e=L(this);M.call(e,e.data())})})}(e)}),function(x,I){var e=function(e,t){var i,s,n=this;t=t||{},this.$element=x(e),this.options=x.extend(!0,{},x.fn.ajaxSelectPicker.defaults,t),this.LOG_ERROR=1,this.LOG_WARNING=2,this.LOG_INFO=3,this.LOG_DEBUG=4,this.lastRequest=!1,this.previousQuery="",this.query="",this.request=!1;var o=[{from:"ajaxResultsPreHook",to:"preprocessData"},{from:"ajaxSearchUrl",to:{ajax:{url:"{{{value}}}"}}},{from:"ajaxOptions",to:"ajax"},{from:"debug",to:function(e){var t={};t.log=Boolean(n.options[e.from])?n.LOG_DEBUG:0,n.options=x.extend(!0,{},n.options,t),delete n.options[e.from],n.log(n.LOG_WARNING,'Deprecated option "'+e.from+'". Update code to use:',t)}},{from:"mixWithCurrents",to:"preserveSelected"},{from:"placeHolderOption",to:{locale:{emptyTitle:"{{{value}}}"}}}];o.length&&x.map(o,function(e){if(n.options[e.from])if(x.isPlainObject(e.to))n.replaceValue(e.to,"{{{value}}}",n.options[e.from]),n.options=x.extend(!0,{},n.options,e.to),n.log(n.LOG_WARNING,'Deprecated option "'+e.from+'". Update code to use:',e.to),delete n.options[e.from];else if(x.isFunction(e.to))e.to.apply(n,[e]);else{var t={};t[e.to]=n.options[e.from],n.options=x.extend(!0,{},n.options,t),n.log(n.LOG_WARNING,'Deprecated option "'+e.from+'". Update code to use:',t),delete n.options[e.from]}});var l=this.$element.data();l.searchUrl&&(n.log(n.LOG_WARNING,'Deprecated attribute name: "data-search-url". Update markup to use: \' data-abs-ajax-url="'+l.searchUrl+"\" '"),this.options.ajax.url=l.searchUrl);var r=function(e,t){return t.toLowerCase()},a=function(e,t,i){var s=[].concat(e),n=s.length,o=i||{};if(n){var l=s.shift();o[l]=a(s,t,o[l])}return n?o:t},c=Object.keys(l).filter(/./.test.bind(new RegExp("^abs[A-Z]")));if(c.length){var p={},h=["locale"];for(i=0,s=c.length;i"),o=x("").attr("label",this.plugin.t("currentlySelected"));for(this.plugin.log(this.plugin.LOG_DEBUG,"Building the select list options from data:",e),i=0;i").appendTo(l.preserved?o:n);if(l.hasOwnProperty("divider"))r.attr("data-divider","true");else for(t in r.val(l.value).text(l.text).attr("title",l.text),l.class.length&&r.attr("class",l.class),l.disabled&&r.attr("disabled",!0),l.selected&&!this.plugin.selectpicker.multiple&&n.find(":selected").prop("selected",!1),l.selected&&r.attr("selected",!0),l.data)l.data.hasOwnProperty(t)&&r.attr("data-"+t,l.data[t])}o.find("option").length&&o["before"===this.plugin.options.preserveSelectedPosition?"prependTo":"appendTo"](n);var a=n.html();return this.plugin.log(this.plugin.LOG_DEBUG,a),a},t.prototype.cacheGet=function(e,t){var i=this.cache[e]||t;return this.plugin.log(this.LOG_DEBUG,"Retrieving cache:",e,i),i},t.prototype.cacheSet=function(e,t){this.cache[e]=t,this.plugin.log(this.LOG_DEBUG,"Saving to cache:",e,t)},t.prototype.destroy=function(){this.replaceOptions(),this.plugin.list.setStatus(),this.plugin.log(this.plugin.LOG_DEBUG,"Destroyed select list.")},t.prototype.refresh=function(e){this.plugin.selectpicker.$menu.css("minHeight",0),this.plugin.selectpicker.$menu.find("> .inner").css("minHeight",0);var t=this.plugin.t("emptyTitle");!this.plugin.$element.find("option").length&&t&&t.length?this.setTitle(t):(this.title||"static"!==this.selectedTextFormat&&this.selectedTextFormat!==this.plugin.selectpicker.options.selectedTextFormat)&&this.restoreTitle(),this.plugin.selectpicker.refresh(),this.plugin.selectpicker.findLis(),e&&(this.plugin.log(this.plugin.LOG_DEBUG,"Triggering Change"),this.plugin.$element.trigger("change.$")),this.plugin.log(this.plugin.LOG_DEBUG,"Refreshed select list.")},t.prototype.replaceOptions=function(e){var t,i,s,n="",o=[],l=[],r=[];if(e=e||[],this.selected&&this.selected.length){for(this.plugin.log(this.plugin.LOG_INFO,"Processing preserved selections:",this.selected),i=(l=[].concat(this.selected,e)).length,t=0;t'}},x.fn.ajaxSelectPicker.locale["en-US"]={currentlySelected:"Currently Selected",emptyTitle:"Select and begin typing",errorText:"Unable to retrieve results",searchPlaceholder:"Search...",statusInitialized:"Start typing a search query",statusNoResults:"No Results",statusSearching:"Searching...",statusTooShort:"Please enter more characters"},x.fn.ajaxSelectPicker.locale.en=x.fn.ajaxSelectPicker.locale["en-US"]}(jQuery,window);